<%include file="header.html"%>
<%include file="top.html"%>
<%include file="left.html"%>
<link rel="stylesheet" href="<%$staticUrl%>css/css.css" />
<script type="text/javascript" src="<%$staticUrl%>js/editor.js"></script> 

		
<div class="main-content">
		<div class="breadcrumbs" id="breadcrumbs">
			<script type="text/javascript">
				try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
			</script>

			<ul class="breadcrumb">
			<li><i class="icon-home home-icon"></i> <a
				href="index.php">首页</a></li>
		     </ul>
		</div>

<div class="page-content">		

<div id="pcDevice" style="display:block" class="col-xs-12">

<div class="alert alert-info">
<form class="form-horizontal" role="form">
<div class="row">
		<!--  
		<label class="col-sm-1 control-label no-padding-right" for="form-field-5">游戏</label>	
		<div class="col-sm-2">
				<select id="selectGame">
					<option value="" >游戏</option>
					<%if $selectGames%> <%foreach from = $selectGames key = key item = value%>
					<%if $nowGame == $value %>
					<option value="<%$value%>" selected><%$value%></option>
					<%else%>
					<option value="<%$value%>"><%$value%></option>
					<%/if%> <%/foreach%> <%/if%>
				</select>
		</div>

		<label class="col-sm-1 control-label no-padding-right" for="form-field-5">渠道</label>	
		<div class="col-sm-2">
				<select id="selectArea">
								<option value="" id="Area">渠道</option>
								<%if $areaInfoArr%> <%foreach from = $areaInfoArr key = key item = value%>
								<%if $nowPlatform == $value %>
								<option value="<%$value%>" selected><%$value%></option>
								<%else%>
								<option value="<%$value%>"><%$value%></option>
								<%/if%> <%/foreach%> <%/if%>
				</select>
		</div>
		
		<div id="lang" style="display:block">
		<label  class="col-sm-1 control-label no-padding-right" for="form-field-5">版本</label>	
		<div  class="col-sm-2">
				<select id="selectLang">
								<option value="" id="selectLangs">版本</option>
								<%if $channels%> <%foreach from = $channels key = key item = value%>
								<%if $nowLang == $value %>
								<option value="<%$value%>" selected><%$value%></option>
								<%else%>
								<option value="<%$value%>"><%$value%></option>
								<%/if%> <%/foreach%> <%/if%>
				</select>
		</div>
		</div>
		
		
		<div class="col-sm-2">	
		<center>
		<button type="button" onClick="formSubmit();"
			class="width-10 btn btn-sm btn-primary">查询</button>
		</center>
		</div>
		-->
		
</div>	
		
</form>						
		
</div>
</div>
<!--
<div  class="col-xs-12">
<div class="col-sm-4">
</div>
	  <label class="col-sm-1 control-label no-padding-right" for="form-field-5">标题:&nbsp;</label>
      <input class="col-sm-2" type="text" class="form-control" placeholder="请输入公告标题" id="title" value="<%$title%>">
        <label class="col-sm-1 control-label no-padding-right" for="form-field-5">nameKey:&nbsp;</label>
      <input class="col-sm-2" type="text" class="form-control" placeholder="<%$nameKey%>" value="<%$nameKey%>" id="nameKey">

</div>
-->

<div class="col-sm-12"> 
<div class="col-sm-4">
</div>
<div style="display:none" class="col-sm-4">
	<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
   <div class="widget-box header-color-blue2">
		<div class="widget-header header-color-blue2">
			<center>	<h4 class="lighter smaller">新增公告</h4> 
			</center>
		</div>
		
        <div class="widget-body ">
               <div  class="widget-main ">
                    <form class="form-horizontal" role="form">
                    
                    <div class="form-group">
                      <label class="col-sm-2 control-label no-padding-right" for="form-field-5"></label>
                      <input class="col-sm-6" type="text" class="form-control" placeholder="请输入小标题" id="title_container" value="<%$minTitle1%>"> 
                    </div>
                    
                     <div class="form-group">
						<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
					   <div style="height:580px;weight:200px;" class="col-sm-12" id="chat_container_" class="ebody">
					   	<table id="chat_table_">
								<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
						  <div class="col-sm-6" id="container" class="ebody">
						 </div>
					   	</table>	
					   </div>	
					 </div>
                    </form>
               </div>
        </div>
       		<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
   			<button  type="submit" onClick="save('container');" class="width-15 btn btn-sm btn-primary">保存 </button>
   			<button   type="submit" onClick="newWindow('container2');" class="width-15 btn btn-sm btn-primary">新增 </button>
   			<button   type="submit" onClick="newWindow('view');" class="width-15 btn btn-sm btn-primary">预览</button>  
   </div>
</div>

<div id ="window_view" style="display:block" class="col-sm-4">
<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
   <div class="widget-box header-color-blue2">
		<div class="widget-header header-color-blue2">
			<center>	<h4 class="lighter smaller">公告预览</h4> 
			</center>
		</div>
		
        <div class="widget-body ">
               <div  class="widget-main ">
                    <form class="form-horizontal" role="form">
                     <div class="form-group">
					   <div style="height:630px;weight:100%;overflow-x:auto;overflow-y:auto;background:#978A71" class="col-sm-12" id="chat_container_" class="ebody">
						  <div   class="col-sm-12" id="view" class="ebody">
						  </div>
					   </div>	
					 </div>
                    </form>
               </div>
        </div>
       		<label class="col-sm-5 control-label no-padding-right" for="form-field-5"></label>
   		<!--  	<button   type="submit" onClick="delWindow('view');" class="width-15 btn btn-sm btn-primary">关闭 </button>   -->
   </div>
</div>

</div>

<!-- overflow-x:auto;overflow-y:auto; -->
<div class="col-sm-12"> 
<div class="col-sm-4">
</div>
<div id ="window_container2" class="col-sm-4" style="display:none">
   <div class="widget-box header-color-blue2">
		<div class="widget-header header-color-blue2">
			<center>	<h4 class="lighter smaller">新增公告</h4>  </center>
		</div>
        <div class="widget-body ">
               <div  class="widget-main ">
                    <form class="form-horizontal" role="form">
                    
                    <div class="form-group">
                      <label class="col-sm-2 control-label no-padding-right" for="form-field-5"></label>
                      <input class="col-sm-6" type="text" class="form-control" placeholder="请输入小标题" id="title_container2" value="<%$minTitle2%>"> 
                    </div>
                    
                     <div class="form-group">
						<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
					   <div style="height:580px;weight:100%;" class="col-sm-12" id="chat_container_" class="ebody">
					   	<table id="chat_table_">
								<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
								<div class="col-sm-12" id="container2" class="ebody">
						 </div>
					   	</table>	
					   </div>	
					 </div>
                    </form>
               </div>
        </div>
       		<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
   			<button  type="submit" onClick="save('container2');" class="width-15 btn btn-sm btn-primary">保存 </button>
   			<button   type="submit" onClick="newWindow('container3');" class="width-15 btn btn-sm btn-primary">新增 </button> 
   			<button   type="submit" onClick="delWindow('container2');" class="width-15 btn btn-sm btn-primary">删除 </button> 
   </div>
</div>

<div class="col-sm-4">
</div>
</div>

<div class="col-sm-12"> 
<div class="col-sm-4">
</div>
<div id ="window_container3" class="col-sm-4" style="display:none">
   <div class="widget-box header-color-blue2">
		<div class="widget-header header-color-blue2">
			<center>	<h4 class="lighter smaller">新增公告</h4>  </center>
		</div>
        <div class="widget-body ">
               <div  class="widget-main ">
                    <form class="form-horizontal" role="form">
                    
                    <div class="form-group">
                      <label class="col-sm-2 control-label no-padding-right" for="form-field-5"></label>
                      <input class="col-sm-6" type="text" class="form-control" placeholder="请输入小标题" id="title_container3" value="<%$minTitle3%>">
                    </div>
                    
                     <div class="form-group">
						<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
					   <div style="height:580px;weight:100%;" class="col-sm-12" id="chat_container_" class="ebody">
					   	<table id="chat_table_">
								<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
								<div class="col-sm-6" id="container3" class="ebody">
						 </div>
					   	</table>	
					   </div>	
					 </div>
                    </form>
               </div>
        </div>
       		<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
   			<button  type="submit" onClick="save('container3');" class="width-15 btn btn-sm btn-primary">保存 </button>
   			<button   type="submit" onClick="newWindow('container4');" class="width-15 btn btn-sm btn-primary">新增 </button> 
   			<button   type="submit" onClick="delWindow('container3');" class="width-15 btn btn-sm btn-primary">删除 </button> 
   </div>
</div>
<div class="col-sm-4">
</div>
</div>


<div class="col-sm-12"> 
<div class="col-sm-4">
</div>
<div id ="window_container4" class="col-sm-4" style="display:none">
   <div class="widget-box header-color-blue2">
		<div class="widget-header header-color-blue2">
			<center>	<h4 class="lighter smaller">新增公告</h4>  </center>
		</div>
        <div class="widget-body ">
               <div  class="widget-main ">
                    <form class="form-horizontal" role="form">
                    
                    <div class="form-group">
                      <label class="col-sm-2 control-label no-padding-right" for="form-field-5"></label>
                      <input class="col-sm-6" type="text" class="form-control" placeholder="请输入小标题" id="title_container4" value="<%$minTitle4%>">
                    </div>
                    
                     <div class="form-group">
						<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
					   <div style="height:580px;weight:100%;" class="col-sm-12" id="chat_container_" class="ebody">
					   	<table id="chat_table_">
								<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
								<div class="col-sm-6" id="container4" class="ebody">
						 </div>
					   	</table>	
					   </div>	
					 </div>
                    </form>
               </div>
        </div>
       		<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
   			<button  type="submit" onClick="save('container4');" class="width-15 btn btn-sm btn-primary">保存 </button>
   			<button   type="submit" onClick="newWindow('container5');" class="width-15 btn btn-sm btn-primary">新增 </button> 
   			<button   type="submit" onClick="delWindow('container4');" class="width-15 btn btn-sm btn-primary">删除 </button> 
   </div>
</div>
<div class="col-sm-4">
</div>
</div>


<div class="col-sm-12"> 
<div class="col-sm-4">
</div>
<div id ="window_container5" class="col-sm-4" style="display:none">
   <div class="widget-box header-color-blue2">
		<div class="widget-header header-color-blue2">
			<center>	<h4 class="lighter smaller">新增公告</h4>  </center>
		</div>
        <div class="widget-body ">
               <div  class="widget-main ">
                    <form class="form-horizontal" role="form">
                    
                    <div class="form-group">
                      <label class="col-sm-2 control-label no-padding-right" for="form-field-5"></label>
                      <input class="col-sm-6" type="text" class="form-control" placeholder="请输入小标题" id="title_container5" value="<%$minTitle5%>">
                    </div>
                    
                     <div class="form-group">
						<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
					   <div style="height:580px;weight:100%;" class="col-sm-12" id="chat_container_" class="ebody">
					   	<table id="chat_table_">
								<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
								<div class="col-sm-6" id="container5" class="ebody">
						 </div>
					   	</table>	
					   </div>	
					 </div>
                    </form>
               </div>
        </div>
       		<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
   			<button  type="submit" onClick="save('container5');" class="width-15 btn btn-sm btn-primary">保存 </button>
   			<button   type="submit" onClick="newWindow('container6');" class="width-15 btn btn-sm btn-primary">新增 </button> 
   			<button   type="submit" onClick="delWindow('container5');" class="width-15 btn btn-sm btn-primary">删除 </button> 
   </div>
</div>
<div class="col-sm-4">
</div>
</div>

<div class="col-sm-12"> 
<div class="col-sm-4">
</div>
<div id ="window_container6" class="col-sm-4" style="display:none">
   <div class="widget-box header-color-blue2">
		<div class="widget-header header-color-blue2">
			<center>	<h4 class="lighter smaller">新增公告</h4>  </center>
		</div>
        <div class="widget-body ">
               <div  class="widget-main ">
                    <form class="form-horizontal" role="form">
                    
                    <div class="form-group">
                      <label class="col-sm-2 control-label no-padding-right" for="form-field-5"></label>
                       <input class="col-sm-6" type="text" class="form-control" placeholder="请输入小标题" id="title_container6" value="<%$minTitle6%>">
                    </div>
                    
                     <div class="form-group">
						<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
					   <div style="height:580px;weight:100%;" class="col-sm-12" id="chat_container_" class="ebody">
					   	<table id="chat_table_">
								<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
								<div class="col-sm-6" id="container6" class="ebody">
						 </div>
					   	</table>	
					   </div>	
					 </div>
                    </form>
               </div>
        </div>
       		<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
   			<button  type="submit" onClick="save('container6');" class="width-15 btn btn-sm btn-primary">保存 </button>
   			<button   type="submit" onClick="newWindow('container7');" class="width-15 btn btn-sm btn-primary">新增 </button> 
   			<button   type="submit" onClick="delWindow('container6');" class="width-15 btn btn-sm btn-primary">删除 </button> 
   </div>
</div>
<div class="col-sm-4">
</div>
</div>

<div class="col-sm-12"> 
<div class="col-sm-4">
</div>
<div id ="window_container7" class="col-sm-4" style="display:none">
   <div class="widget-box header-color-blue2">
		<div class="widget-header header-color-blue2">
			<center>	<h4 class="lighter smaller">新增公告</h4>  </center>
		</div>
        <div class="widget-body ">
               <div  class="widget-main ">
                    <form class="form-horizontal" role="form">
                    
                    <div class="form-group">
                      <label class="col-sm-2 control-label no-padding-right" for="form-field-5"></label>
                      <input class="col-sm-6" type="text" class="form-control" placeholder="请输入小标题" id="title_container7" value="<%$minTitle7%>">
                    </div>
                    
                     <div class="form-group">
						<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
					   <div style="height:580px;weight:100%;" class="col-sm-12" id="chat_container_" class="ebody">
					   	<table id="chat_table_">
								<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
								<div class="col-sm-6" id="container7" class="ebody">
						 </div>
					   	</table>	
					   </div>	
					 </div>
                    </form>
               </div>
        </div>
       		<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
   			<button  type="submit" onClick="save('container7');" class="width-15 btn btn-sm btn-primary">保存 </button>
   			<button   type="submit" onClick="newWindow('container8');" class="width-15 btn btn-sm btn-primary">新增 </button> 
   			<button   type="submit" onClick="delWindow('container7');" class="width-15 btn btn-sm btn-primary">删除 </button> 
   </div>
</div>
<div class="col-sm-4">
</div>
</div>


<div class="col-sm-12"> 
<div class="col-sm-4">
</div>
<div id ="window_container8" class="col-sm-4" style="display:none">
   <div class="widget-box header-color-blue2">
		<div class="widget-header header-color-blue2">
			<center>	<h4 class="lighter smaller">新增公告</h4>  </center>
		</div>
        <div class="widget-body ">
               <div  class="widget-main ">
                    <form class="form-horizontal" role="form">
                    
                    <div class="form-group">
                      <label class="col-sm-2 control-label no-padding-right" for="form-field-5"></label>
                      <input class="col-sm-6" type="text" class="form-control" placeholder="请输入小标题" id="title_container8" value="<%$minTitle8%>"> 
                    </div>
                    
                     <div class="form-group">
						<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
					   <div style="height:580px;weight:100%;" class="col-sm-12" id="chat_container_" class="ebody">
					   	<table id="chat_table_">
								<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
								<div class="col-sm-6" id="container8" class="ebody">
						 </div>
					   	</table>	
					   </div>	
					 </div>
                    </form>
               </div>
        </div>
       		<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
   			<button  type="submit" onClick="save('container8');" class="width-15 btn btn-sm btn-primary">保存 </button>
   			<button   type="submit" onClick="newWindow('container9');" class="width-15 btn btn-sm btn-primary">新增 </button> 
   			<button   type="submit" onClick="delWindow('container8');" class="width-15 btn btn-sm btn-primary">删除 </button> 
   </div>
</div>
<div class="col-sm-4">
</div>
</div>

<div class="col-sm-12"> 
<div class="col-sm-4">
</div>
<div id ="window_container9" class="col-sm-4" style="display:none">
   <div class="widget-box header-color-blue2">
		<div class="widget-header header-color-blue2">
			<center>	<h4 class="lighter smaller">新增公告</h4>  </center>
		</div>
        <div class="widget-body ">
               <div  class="widget-main ">
                    <form class="form-horizontal" role="form">
                    
                    <div class="form-group">
                      <label class="col-sm-2 control-label no-padding-right" for="form-field-5"></label>
                       <input class="col-sm-6" type="text" class="form-control" placeholder="请输入小标题" id="title_container9" value="<%$minTitle9%>">  
                    </div>
                    
                     <div class="form-group">
						<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
					   <div style="height:580px;weight:100%;" class="col-sm-12" id="chat_container_" class="ebody">
					   	<table id="chat_table_">
								<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
								<div class="col-sm-6" id="container9" class="ebody">
						 </div>
					   	</table>	
					   </div>	
					 </div>
                    </form>
               </div>
        </div>
       		<label class="col-sm-4 control-label no-padding-right" for="form-field-5"></label>
   			<button  type="submit" onClick="save('container9');" class="width-15 btn btn-sm btn-primary">保存 </button>
   		<!--  	<button   type="submit" onClick="newWindow('container10');" class="width-15 btn btn-sm btn-primary">新增 </button>  -->
   			<button   type="submit" onClick="delWindow('container9');" class="width-15 btn btn-sm btn-primary">删除 </button> 
   </div>
</div>
<div class="col-sm-4">
</div>
</div>

</div>

</div>

				
<script type="text/javascript">
window.onload = function () {
	
	<%if $viewData%>
		text = unModifyText('<%$viewData%>');
		$("#view").html(text);	
	<%/if%>
	
	<%if $content%>
	 $("#econtent").contents().find("body").html('<%$content%>');	
	<%/if%>
	<%if $minContent1%>
		text = unModifyText('<%$minContent1%>');
		
	$("#view").html(text);	
	$("#econtent_container").contents().find("body").html(text);	
	<%/if%>
	
	<%if $minContent2%>
	text = unModifyText('<%$minContent2%>');
	$("#econtent_container2").contents().find("body").html(text);	
	<%/if%>
	
	<%if $minContent3%>
	text = unModifyText('<%$minContent3%>');
	$("#econtent_container3").contents().find("body").html(text);	
	<%/if%>
	
	<%if $minContent4%>
	text = unModifyText('<%$minContent4%>');
	$("#econtent_container4").contents().find("body").html(text);	
	<%/if%>
	
	<%if $minContent5%>
	text = unModifyText('<%$minContent5%>');
	$("#econtent_container5").contents().find("body").html(text);	
	<%/if%>
	
	<%if $minContent6%>
	text = unModifyText('<%$minContent6%>');
	$("#econtent_container6").contents().find("body").html(text);	
	<%/if%>
	
	<%if $minContent7%>
	text = unModifyText('<%$minContent7%>');
	$("#econtent_container7").contents().find("body").html(text);	
	<%/if%>
	
	<%if $minContent8%>
	text = unModifyText('<%$minContent8%>');
	$("#econtent_container8").contents().find("body").html(text);	
	<%/if%>
	
	<%if $minContent9%>
	text = unModifyText('<%$minContent9%>');
	$("#econtent_container9").contents().find("body").html(text);	
	<%/if%>
	
	
	<%if $minTitleNums && $minTitleNums >= 2 %>
	  $('#window_container2').css("display", "block");
	<%/if%>
	
	<%if $minTitleNums && $minTitleNums >= 3 %>
	  $('#window_container3').css("display", "block");
	<%/if%>
	
	<%if $minTitleNums && $minTitleNums >= 4 %>
	  $('#window_container4').css("display", "block");
	<%/if%>
	
	<%if $minTitleNums && $minTitleNums >= 5 %>
	  $('#window_container5').css("display", "block");
	<%/if%>
	
	<%if $minTitleNums && $minTitleNums >= 6 %>
	  $('#window_container6').css("display", "block");
	<%/if%>
	
	<%if $minTitleNums && $minTitleNums >= 7 %>
	  $('#window_container7').css("display", "block");
	<%/if%>
	
	<%if $minTitleNums && $minTitleNums >= 8 %>
	  $('#window_container8').css("display", "block");
	<%/if%>
	
	<%if $minTitleNums && $minTitleNums >= 9 %>
	  $('#window_container9').css("display", "block");
	<%/if%>
	
	
	 <%if $viewLang && $viewLang == 1 %>
	 $('#lang').css("display", "block");
	 <%/if%>
}	

	// 刷新页面
	function reflush() {
		window.location.href = window.location.href;
	}
	// 新增窗口
   function newWindow(id) {
	   $('#window_'+id).css("display", "block");	   
   }
	
	// 删除窗口
   function delWindow(id) {
	   $('#window_'+id).css("display", "none");	   
   }
	
	function formSubmit() {
		var selectGame = $('#selectGame').val();
		var selectArea = $('#selectArea').val();
		var selectLang = $('#selectLang').val();
		
		if (!selectGame) {
			alert('请选择游戏！');
		} else if(!selectArea) {
			alert("请选择渠道");
		} else if(!selectLang) {
			alert("请选择版本");
		} else {
			url = "index.php?mod=Data&do=selectNotices&game="
				+ selectGame
				+ "&selectArea="
				+ selectArea
				+ "&selectLang="
				+ selectLang;
			window.location.href = url;
		}
	}
	
	function save(id) {
		var param = {};
		param['mod'] = 'Announce';
		param['do']  = 'save';
		// 游戏  渠道  分类 
		var game 	= $('#selectGame').val();
		var channel 	= $('#selectArea').val();
		var version 	= $('#selectLang').val();
		
		var title 	= $('#title').val();	// 大标题
		var minTitle 	= $('#title_'+id).val();	// 小标题
		
		param['nameKey'] 	= "<%$nameKey%>";
		param['title'] 	= title;
		param['minTitle'] 	= minTitle;
		param['game']  	  = game;
		param['channel']  = channel;	// 渠道
		param['version']  = version;	// 版本
	//	param['fileName']  = "<%$nameKey%>";;	// 文件名
		
		var win = document.getElementById('econtent_'+id).contentWindow;
		var content = win.document.body.innerHTML;
		
		// 格式化
		content = modifyText(content);
		
	    param['content'] = content;
	    if(!game) {
	    	alert("清选择游戏");
	    } else if (!channel) {
	    	alert("清选择渠道");
	    } else if (!version) {
	    	alert("请选择版本");
	    } else if (!title) {
	    	alert("请输入标题");
	    }  else if (!minTitle) {
	    	alert("请输入小标题");
	    } else if (!content) {
	    	alert("请输入公告内容");
	    } else { 
	    	$.ajax({
				type:'POST',
				url:'index.php',
				data:param,
				dataType:'html',
				success:function(data) {
					alert(data);
				}
			});
	    }
	}

	// 格式化 
	function modifyText (intxt){
		
		text = intxt;
		text = text.replace(/<div>/g,"<p>");
		text = text.replace(/<\/div>/g,"<\/p>");
		text = text.replace(/<br>/g,"<br\/>");
		
		//text = text.replace(/<font/g,"<font face=\"Helvetica20\"");
		//text = text.replace(/<a href=\"http:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?\">/g,"<button name = \"URL\" value=\"$1\">");
		//text = text.replace(/<a href=\"([\w-]+\.+[\w-]+\/[\w- ./?%&=]*)?\">/g,"<button name = \"URL\" value=\"$1\">");
		//text = text.replace(/<a href=\"(\w+)\">/g,"<button name = \"URL\" value=\"$1\">");
		text = text.replace(/<a href=/g,"<button name = \"URL\" value=");
		text = text.replace(/<a /g,"<button ");
		text = text.replace(/<\/a>/g,"<\/button>");
		text = text.replace(/class=\"[^\"]+\"/g,"");
		//text = text.replace(/&nbsp;/g,"");
		
		// { } 内容为居中
		text = text.replace(/{/g,'<p align="center">');
		text = text.replace(/}/g,'</p>');
		
		text = text.replace(/<o:p><\/o:p>/g,"<br/>");
		text = text.replace(/lang=\"[^\"]+\"/g,"");
	
		//现将font=的大小设定为像素
		text = text.replace(/<font[^>]+size=\"([0-9])\"/g,function(s){
			var size = s.substr(-2,1)*2+18;
			if(size==24)size="";
			return s.slice(0,-2)+size+"\"";
		});
	
		text = text.replace(/(<[^>]+)color:red/g,"$1color:#FF0000");
		text = text.replace(/style=\"([^\"]*)color:#([A-Fa-f0-9]{6})/g,"color=\"#$2\" style=\"$1");
		text = text.replace(/mso-bidi-font-size/g,"");
		text = text.replace(/style=\"([^\"]*)font-size:([0-9]{2})/g,"size=\"$2\" style=\"$1");
		//text = text.replace(/style=\"color:#([A-Fa-f0-9]{6})\"/g,"color=\"#$1\"");
		//text = text.replace(/style=\"[^\"]+color:#([A-Fa-f0-9]{6})\"/g,"color=\"#$1\"");
		//text = text.replace(/style=\"color:#([A-Fa-f0-9]{6})[^\"]+\"/g,"color=\"#$1\"");
		//text = text.replace(/style=\"[^\"]+color:#([0-9a-fA-F]{6})[^\"]+\"/g,"color=\"#$1\"");
		text = text.replace(/style=\"[^\"]+\"/g,"");
		text = text.replace(/span/g,"font");
	
		text = text.replace(/(<font[^>]+)size=\"([0-9]{2})\"/g,"$1face=\"Helvetica$2\"");
		text = text.replace(/(<font[^>]+)face=\"Helvetica24\"/g,"$1face=\"Helvetica\"");
		
	
		text = text.replace(/<font><\/font>/g,"");
		text = text.replace(/<font[ ]+color=\"#[A-Fa-f0-9]{6}\"><\/font>/g,"");
		return text;
	}
	 
	// 反格式化
	function unModifyText(intxt){
		var text = intxt;
		//text = text.replace(/<p>/g,"<div>");
		//text = text.replace(/<\/p>/g,"<\/div>");
		//text = text.replace(/<br>/g,"<br\/>");
		//text = text.replace(/<button name = \"URL\" value=\"\w+\">/g,"<a href=\"$1\">");
		text = text.replace(/<button name = \"URL\" value=/g,"<a href=");
		text = text.replace(/<\/button>/g,"<\/a>");
		text = text.replace(/face=\"Helvetica[0-9]{2}/g,function(s){
			var size = (s.substr(-2,2)*1-18)/2;
			return "size=\""+size;
		});
		return text
	}
	
	 var select = document.getElementById('selectGame');
	 select.onchange = function(){
	        // 更改值后执行的代码
	       var gameName = jQuery("#selectGame  option:selected").text();
	        
	       $.ajax({
	    	    type: "POST",
				url: "index.php?mod=Game&do=getAreaByGame&game=" + gameName,
				data: "",
				dataType: 'html',
				success: function(data) {
					var dataObj = eval("(" + data + ")");//转换为json对象
					if(dataObj == null) {
						$("#selectArea").empty();
						$("#selectArea").append('<option value="" id="selectPlatform">渠道</option>');
					}
					
					var platform = dataObj.platform;
					
					$("#selectArea").empty();
					$("#selectArea").append('<option value="" id="selectArea">渠道</option>');
					for(var i=0;i<platform.length;i++){
						$("#selectArea").append("<option value='"+platform[i]+"' >"+platform[i]+"</option>"+"<br/>");
					}
				}
	       });
	  }
	 
	 
	 var selectArea = document.getElementById('selectArea');
	 selectArea.onchange = function(){
	        // 更改值后执行的代码
	       var areaName = jQuery("#selectArea  option:selected").text();
	       var game 	= $('#selectGame').val();
	       
	       // var lang = document.getElementById('selectArea');
	    //   if (areaName == "r2") {
	    //	   $('#lang').css("display", "block");
	     //  }
	        $.ajax({
	    	    type: "POST",
				url: "index.php?mod=Game&do=getLangByAreaGame&game="+game+"&areaName="+areaName,
				data: "",
				dataType: 'html',
				success: function(data) {
					
					var dataObj = eval("(" + data + ")");//转换为json对象
					if(dataObj == null) {
						$("#selectLang").empty();
						$("#selectLang").append('<option value="" id="selectPlatform">版本</option>');
					}
					
					var platform = dataObj.platform;
					
					if(platform.length > 1) {
						 $('#lang').css("display", "block");
					} else {
						 $('#lang').css("display", "none");
					}
					
					$("#selectLang").empty();
					$("#selectLang").append('<option value="" id="selectLang">版本</option>');
					for(var i=0;i<platform.length;i++){
						$("#selectLang").append("<option value='"+platform[i]+"' >"+platform[i]+"</option>"+"<br/>");
					}
				}
	       });
	   
	  }
	 

	var bardata = [
		{'index': 2, 'title': '下划线', 'class': 'tag curr2', 'hover': 'curr2_hover', 'active': 'curr2_active', 'unselectable': 'on', 'command': 'underline' },
		{'index': 3, 'title': 'Font-Size', 'class': 'tag curr3', 'hover': 'curr3_hover', 'active': 'curr3_active', 'unselectable': 'on', 'command': 'fontSize' },
		{'index': 5, 'title': '文字颜色', 'class': 'tag curr5', 'hover': 'curr5_hover', 'active': 'curr5_active', 'unselectable': 'on', 'command': 'foreColor' },
		{'index': 6, 'title': 'Insert-Link', 'class': 'tag curr6', 'hover': 'curr6_hover', 'active': 'curr6_active', 'unselectable': 'on', 'command': 'createLink'},
		{'index': 7, 'title': '剪贴', 'class': 'tag curr7', 'hover': 'curr7_hover', 'active': 'curr7_active', 'unselectable': 'on', 'command': 'cut' },
		{'index': 8, 'title': '复制', 'class': 'tag curr8', 'hover': 'curr8_hover', 'active': 'curr8_active', 'unselectable': 'on', 'command': 'copy'},

	];
	
	var e = new editor('container', bardata);
	var f = new editor('container2', bardata);
	var g = new editor('container3', bardata);
	var h = new editor('container4', bardata);
	var i = new editor('container5', bardata);
	var j = new editor('container6', bardata);
	var k = new editor('container7', bardata);
	var l = new editor('container8', bardata);
	var m = new editor('container9', bardata);

	
</script>				
<%include file="footer.html"%>

